package com.gwd.task.model;

import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author zhiyongming
 * @date 2020/12/31 11:06
 * 工作统计
 */
@Data
@NoArgsConstructor
public class WorkStatisticsDTO {
    private Long userId;
    private String userName;
    private Integer dev;
    private Integer events;
    private Integer selfTest;
    private Integer test;
    private Integer back;
    private Integer total;

    public WorkStatisticsDTO(Long userId, Integer type) {
        this.dev = 0;
        this.events = 0;
        this.test = 0;
        this.back = 0;
        this.selfTest = 0;
        this.userId = userId;
        switch (type) {
            case 0:
                this.dev++;
                break;
            case 1:
                this.events++;
                break;
            case 2:
                this.test++;
                break;
        }
    }

    public void plusDev() {
        this.dev++;
    }

    public void plusEvent() {
        this.events++;
    }

    public void plusTest() {
        this.test++;
    }
    public void plusBack() {
        this.back++;
    }

    public void plusSelfTest() {
        this.selfTest++;
    }

    public void computeTotal() {
        this.total = this.dev + this.events + this.test + this.back;
    }

}
